﻿<%@ Page Title="" EnableEventValidation="false" Language="C#" MasterPageFile="~/MasterPage/Administrator.Master" AutoEventWireup="true" CodeBehind="CreateSurvey.aspx.cs" Inherits="ProjectSemIII.Administrator.Survey.CreateSurvey" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    Create Survey
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div runat="server" id="divSurveyInfo">
        <div class="widget">
            <div class="whead">
                <h6>Choose Survey Catalog</h6>
                <div class="clear"></div>
            </div>
            <div class="formRow">
                <div class="grid3">
                    <label>Suvey Catalog:<span class="req">*</span></label>
                    <div class="selector">
                        <span runat="server" id="nameChoose">Select Catalog Name</span>
                        <asp:DropDownList AutoPostBack="true" ID="SurveyCatalogName" runat="server" Width="145px" OnSelectedIndexChanged="SurveyCatalogName_SelectedIndexChanged">
                        </asp:DropDownList>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </div>

        <div class="divider"><span></span></div>

        <div class="pagination">
            <asp:Label Text="Error dfgserfg jdksgbjksdb fjrkwb fvkjs bdjvkr t" runat="server" ID="lbError"></asp:Label>
        </div>
        <div class="fluid">
            <form id="validate" class="main" method="post" action="POST">
                <fieldset>
                    <div class="widget">
                        <div class="whead">
                            <h6>Survey Information</h6>
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
                            <div class="grid3">
                                <label>Survey Name:<span class="req">*</span></label>
                            </div>
                            <div class="grid9">
                                <asp:TextBox runat="server" CssClass="validate[required]" name="txtSurveyName" ID="txtSurveyName" />
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
                            <div class="grid3">
                                <label>The Number Of Questions:<span class="req">*</span></label>
                            </div>
                            <div class="grid9">
                                <asp:TextBox runat="server" CssClass="validate[required]" name="txtSurveyName" ID="txtNumberQuestion" />
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
                            <div class="grid3">
                                <label>Survey Description:<span class="req">*</span></label>
                            </div>
                            <div class="grid9">
                                <CKEditor:CKEditorControl ID="txtSurveyDesc" BasePath="~/ckeditor" CssClass="validate[required]" runat="server"></CKEditor:CKEditorControl>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
                            <div class="grid3">
                                <label>Survey Group:<span class="req">*</span></label>
                            </div>
                            <div class="grid9">
                                <div class="selector">
                                    <span runat="server" id="idGroup">Select Group Join Survey</span>
                                    <asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="ddPlayer_SelectedIndexChanged" runat="server" CssClass="validate[required]" name="ddPlayer" ID="ddPlayer">
                                        <asp:ListItem Selected="True" Text="Select Group Join Survey" Value="-1"></asp:ListItem>
                                        <asp:ListItem Text="Student" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="Staff" Value="2"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
                            <div class="grid3">
                                <label>Survey Image:</label>
                            </div>
                            <div class="grid9">
                                <asp:FileUpload runat="server" CssClass="validate[required]" name="fuImages" ID="fuImages" />
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
                            <div class="grid3">
                                <label>Start Date:<span class="req">*</span></label>
                            </div>
                            <div class="grid9">
                                <asp:Calendar OnDayRender="startDate_DayRender" OnSelectionChanged="startDate_SelectionChanged" runat="server" ID="startDate" BackColor="White" BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" Width="200px">
                                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                                    <NextPrevStyle VerticalAlign="Bottom" />
                                    <OtherMonthDayStyle ForeColor="#808080" />
                                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                                    <SelectorStyle BackColor="#CCCCCC" />
                                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                                    <WeekendDayStyle BackColor="#FFFFCC" />
                                </asp:Calendar>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
                            <div class="grid3">
                                <label>Dead Line:<span class="req">*</span></label>
                            </div>
                            <div class="grid9">
                                <asp:Calendar OnDayRender="deadLine_DayRender" runat="server" ID="deadLine" BackColor="White" BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" Width="200px">
                                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                                    <NextPrevStyle VerticalAlign="Bottom" />
                                    <OtherMonthDayStyle ForeColor="#808080" />
                                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                                    <SelectorStyle BackColor="#CCCCCC" />
                                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                                    <WeekendDayStyle BackColor="#FFFFCC" />
                                </asp:Calendar>
                            </div>
                            <div class="clear"></div>
                        </div>
                        <div class="formRow">
                            <div class="grid3">
                                <label><span class="req"></span></label>
                            </div>
                            <div class="grid9">
                                <asp:Button ID="submitStep1" Text="Next Step" OnClick="submitStep1_Click" runat="server" CssClass="buttonS bLightBlue" />
                            </div>
                            <div class="clear"></div>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
    <script src="../../App_Themes/Administrator/js/jquery-ui.js" type="text/javascript"></script>
    <script src="../../App_Themes/Administrator/js/jquery-1.8.3.js" type="text/javascript"></script>
    <script type="text/javascript">
        function GetDynamicTextBox(value) {
            return '<input name="DynamicTextBox" id="txtCountry" class="#tags" style="width:80%" type="text" value="' + value + '" />&nbsp&nbsp&nbsp' +
                    '<input type="button" class="buttonS bLightBlue" value="Remove" onclick = "RemoveTextBox(this)" /><br /><br />'
        }
        function AddTextBox() {
            var div = document.createElement('DIV');
            div.innerHTML = GetDynamicTextBox("");
            document.getElementById("TextBoxContainer").appendChild(div);
        }

        function RemoveTextBox(div) {
            document.getElementById("TextBoxContainer").removeChild(div.parentNode);
        }

        function RecreateDynamicTextboxes() {
            v 
            if (values != null) {
                var html = "";
                for (var i = 0; i < values.length; i++) {
                    html += "<div>" + GetDynamicTextBox(values[i]) + "</div>";
                }
                document.getElementById("TextBoxContainer").innerHTML = html;
            }
        }
        window.onload = RecreateDynamicTextboxes;
    </script>
    <div runat="server" id="divSurveyDetail">
        <div class="pagination">
            <asp:Label Text="Error dfgserfg jdksgbjksdb fjrkwb fvkjs bdjvkr t" runat="server" ID="lbErrorQuestion"></asp:Label>
        </div>
        <div class="fluid">
            <fieldset>
                <div class="widget">
                    <div class="whead">
                        <h6 runat="server" id="lbQuestionNumber">Question Number One</h6>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Answers Type:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <div class="floatL mr10">
                                <asp:RadioButton ID="rbRadio" AutoPostBack="true" Checked="true" runat="server" Text="RadioButton" GroupName="QuestionGroup" />
                            </div>
                            <div class="floatL mr10">
                                <asp:RadioButton ID="rbCheckBox" AutoPostBack="true" runat="server" Text="CheckBox" GroupName="QuestionGroup" />
                            </div>
                            <div class="floatL mr10">
                                <asp:RadioButton ID="rbComment" AutoPostBack="true" runat="server" Text="Comment" GroupName="QuestionGroup" />
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Question Detail:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <CKEditor:CKEditorControl ID="txtQuestion" BasePath="~/ckeditor" runat="server"></CKEditor:CKEditorControl>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow" id="answerForm" runat="server">
                        <div class="grid3">
                            <label>Answers Detail:&nbsp<input id="btnAdd" type="button" class="buttonS bLightBlue" value="New Answer" onclick="AddTextBox()" /></label>
                        </div>
                        <div class="grid9">
                            <div id="TextBoxContainer"></div>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label><span class="req"></span></label>
                        </div>
                        <div class="grid9">
                            <div>
                                <div style="float: left">
                                    <asp:Button ID="btPrev" Text="Prev" runat="server" CssClass="buttonS bLightBlue" />
                                </div>
                                <div style="float: left; margin-left: 100px">
                                    <asp:Button ID="btNext" OnClick="btNext_Click" Text="Next Question" runat="server" CssClass="buttonS bLightBlue" />
                                </div>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </fieldset>
        </div>
        <div class="divider"><span></span></div>
    </div>
</asp:Content>
